<div class="container-fluid domainSet-body">
	<div class="row-fluid">
		<div class="span12">
			<form class="form-horizontal" id="ruleForm">
				<legend><?php echo $info['domain_name']; ?>缓存配置</legend>
				<div class="control-group">
					<label class="control-label">匹配类型</label>
					<div class="controls">
						<select class="input-small" name="rule_type">
							<option value="dir">目录</option>
							<option value="file">文件类型</option>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">匹配规则</label>
					<div class="controls">
						<input type="text" name="rule">
						<span class="help-inline">目录:/xxx 文件类型:jsp|php|asp</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">缓存</label>
					<div class="controls">
						<select class="input-mini" name="is_cache">
							<option value="yes">是</option>
							<option value="no">否</option>
						</select>
						<input type="text" value="1" class="input-mini" name="cache"> 天
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">排序权重</label>
					<div class="controls">
						<input type="text" value="0" class="input-small" name="weight">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">备注</label>
					<div class="controls">
						<input type="text" value="" name="name" />
						<input type="hidden" value="<?php echo $domain_id; ?>" name="domain_id" />
					</div>
				</div>
				<div class="form-actions">
					<a href="javascript:post('ruleForm', './?api:domainRuleAdd', function(){window.location.reload()});" class="btn btn-primary">添加</a>
				</div>
			</form>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>匹配规则</th>
						<th>匹配类型</th>
						<th>缓存</th>
						<th>权重</th>
						<th>备注</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($list as $key => $value) {	?>
						<tr>
							<td><?php echo $value['rule']; ?></td>
							<td>
								<?php if($value['rule_type'] == 'dir'){ ?>
									目录
								<?php }elseif($value['rule_type'] == 'file'){ ?>
									文件类型
								<?php }else{ ?>
									正则
								<?php } ?>
							</td>
							<td>
								<?php if($value['cache'] == 0){ ?>
									否
								<?php }else echo "{$value['cache']}天"; ?>
							</td>
							<td>
								<?php echo $value['weight']; ?>
							</td>
							<td>
								<?php echo $value['name']; ?>
							</td>
							<td>
								<a href="javascript:void(0);" onclick="confirm('是否删除该规则',function(){ruleRemove(<?php echo $value['conf_id'] ?>)});" ;="">
								<i class="icon-remove"></i>
								</a>
							</td>
						</tr>
					<?php } ?>				
				</tbody>
			</table>
		</div>
	</div>
</div>
			